package com.airticketbooking.service.serviceImpl;


import com.airticketbooking.po.Airline;
import com.airticketbooking.query.AirlinePageQuery;
import com.airticketbooking.mapper.AirlineMapper;
import com.airticketbooking.service.AirlineService;
import com.github.pagehelper.PageHelper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;

/**
 * (Airlines)表服务实现类
 *
 * @author makejava
 * @since 2024-10-10 14:33:49
 */
@Service
@RequiredArgsConstructor

public class AirlineServiceImpl implements AirlineService {

	private final AirlineMapper airlineMapper;

	/**
	 * 通过ID查询单条数据
	 *
	 * @param airlineId 主键
	 * @return 实例对象
	 */
	@Override
	public Airline queryById(Integer airlineId) {
		return airlineMapper.queryById(airlineId);
	}


	/***
	 * @param airlinePageQuery
	 * @return: org.springframework.data.domain.Page<com.airticketbooking.domain.po.Airline>
	 * @Author: susu
	 * @date: 2024/10/10
	 * @since 1.0.0
	 * @Description:
	 */
	@Override
	public Page<Airline> queryByPage(AirlinePageQuery airlinePageQuery) {

		PageHelper.startPage(airlinePageQuery.getPageNo(), airlinePageQuery.getPageSize());


		Page<Airline> airlinePage = airlineMapper.queryByPage(airlinePageQuery);

		return airlinePage;

	}


}
